import com.study.Student;
import com.study.User;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class test {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
        Student student = (Student) context.getBean("student");
        System.out.println(student.toString());
        /*
        Student{
            name='张三',
            address=Address{address='北京市'},
            books=[红楼梦, 西游记, 水浒传, 三国演艺],
            hobbys=[学习, 健身, 游戏],
            card={身份证=123456789, 手机号=110, 邮箱=110@qq.com},
            games=[蜘蛛纸牌, 扫雷, 吃鸡],
            wife='null',
            info={姓名=SB, 学号=18082112, 性别=男}
            }
         */



    }

    @Test
    public void test2(){
        ApplicationContext context = new ClassPathXmlApplicationContext("userbeans.xml");
        User user = context.getBean("user",User.class);
        User user2 = context.getBean("user2",User.class);
        System.out.println(user2);

    }
}
